You can use the assignment operator (=) and the assignment keyword "Let" (Let x=y) with only Basic syntax. Crystal syntax uses the other assignment operator (:=).
Assigns y to the variable x. x must have already been declared before the assignment. y must be of the same type as x, or of a type compatible with x.
Assigns y to the variable x. x must have already been declared before the assignment. y must be of the same type as x, or of a type compatible with x.
The following example is applicable to Basic syntax:
'b is assigned the Boolean value True
'c is assigned the Currency value 5000
'd is assigned the Date value of Oct. 10, 1999
't is assigned the Time value 12:50am
' s is assigned a string which is a concatenation of 2 substrings and a field value
s = "The total sales is " & {Orders.Order Amount} & " billion."
' numArray is assigned an array of Number values
You can use the assignment operator (:=) with only Crystal syntax. For more details, see Variable declarations (Crystal syntax).
Assigns the value n to the variable x. (x must have already been declared in the same formula.)
The following examples are applicable to Crystal syntax:
Initializes (sets to zero) the variable named Amount.
Assigns the value 100 to the variable named Amount.
Assigns the result of a calculation to the variable named Amount. The calculation adds the value of the quantity field ({file.QTY}) to the current value of the Amount variable.
Amount:= {file.QTY1} + {file.QTY2} + {file.QTY3}
Totals the three quantity fields and assigns the total to the variable named Amount.
Assigns the string "Westside Motors" to the variable named Customer.
Customer:= {customer.FIRST NAME} + {customer.LAST NAME}
concatenates two fields and assigns the concatenated value of both fields to the variable named Customer.
Customer:= TrimRight({customer.FIRST NAME}) + {customer.LAST NAME}
Trims the trailing blanks from the first name field ({customer.FIRST NAME}), concatenates that field to the last name field ({customer.LAST NAME}), and assigns the concatenated value of both fields to the variable named Customer.
Customer:= "Mr. " + {customer.LAST NAME}
Concatenates the string "Mr. " with the value of the last name field {customer.LAST NAME} and assigns the concatenated value to the variable named Customer.
Amount:= 100; Customer:= "Westside Motors"
Assigns the constant 100 to the number variable named Amount and assigns the string "Westside Motors" to the string variable named Customer. You can assign values to multiple variables by separating the assignment statements with semicolons.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |